package panda.server;

/** Represents one line in a deck.txt file. Each line is in the format "n cardname" */
public class DeckScannerLine implements Comparable<DeckScannerLine> {
	private int numCards;
	private String cardName;

	public DeckScannerLine(int numCards, String cardName) {
		this.numCards = numCards;
		this.cardName = cardName;
	}

	public int getNumCards() {
		return numCards;
	}

	public String getCardName() {
		return cardName;
	}

	public int compareTo(DeckScannerLine o) {
		if(o.numCards > numCards) {
			return 1;
		} else if(o.numCards < numCards) {
			return -1;
		} else {
			assert (o.numCards == numCards);
			return 0;
		}
	}
	
	public String toString() {
		return numCards + ": " + cardName;
	}
}